<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="../style.css" type="text/css" media="all" />
<body>
<h1>1.4 Написание нового модуля</h1>
<div><p>В качестве примера рассмотрим процесс написания модуля mymodule, который
будет выводить список последных публикаций в блогах.</p>
<p>Основные файлы, которые требуется создать:
<br>~/explay/modules/mymodule - каталог для PHP-скриптов модуля
<br>~/explay/modules/mymodule/class.php - класс модуля
<br>~/explay/modules/mymodule/i18n.ru.php - языковой файл
<br>~/explay/templates/xsl/mymodule - каталог для шаблонов модуля
<br>~/explay/templates/xsl/mymodule/index.xsl - шаблон страницы, который будет использоваться для вывода списка.</p>
</div>

<h2>Класс</h2>
<div>Файл <i>~/explay/modules/mymodule/class.php</i></div>
<div class="sample">
<div class="sample_content">
<code><span style="color: #000000"> <span style="color: #0000BB">&lt;?php <br /> <br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">mymodule&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">Module&nbsp;</span><span style="color: #007700">{ <br /> <br />&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">__construct&nbsp;</span><span style="color: #007700">()&nbsp;{ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">parent</span><span style="color: #007700">::</span><span style="color: #0000BB">__construct&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">__CLASS__</span><span style="color: #007700">); <br />&nbsp;&nbsp;&nbsp;&nbsp;} <br />&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">__default&nbsp;</span><span style="color: #007700">()&nbsp;{ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$typesController&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">TypesController</span><span style="color: #007700">::</span><span style="color: #0000BB">getInstance&nbsp;</span><span style="color: #007700">(); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Получаем&nbsp;типы&nbsp;"статья"&nbsp;и&nbsp;"ссылка" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$oTypeArticle&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$typesController</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTypeByName&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">'article'</span><span style="color: #007700">); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$oTypeLink&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$typesController</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTypeByName&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">'link'</span><span style="color: #007700">); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$onPage&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">12</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;Количество&nbsp;объектов&nbsp;на&nbsp;странице <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$currentPage&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">getRequest&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">'page'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'int'</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;Получаем&nbsp;текущюю&nbsp;страницу&nbsp;из&nbsp;массива&nbsp;$_REQUEST <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$currentPage&nbsp;</span><span style="color: #007700">!=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$currentPage</span><span style="color: #007700">--; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$sel&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Selection</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;Иницализируем&nbsp;выборку&nbsp;списка&nbsp;объектов <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$sel</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addType&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$oTypeArticle</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;Добавляем&nbsp;тип&nbsp;статьи&nbsp;к&nbsp;типам&nbsp;выбираемых&nbsp;объектов <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$sel</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addType&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$oTypeLink</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;Аналогично&nbsp;с&nbsp;ссылкой <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$sel</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addFilter&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">'draft'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'0'</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;Фильтр,&nbsp;запрещающий&nbsp;вывод&nbsp;черновиков <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$sel</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setOrder&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">'pubdate'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;Сортируем&nbsp;по&nbsp;дате&nbsp;публикации,&nbsp;новые&nbsp;сверху <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$sel</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addLimit&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$currentPage</span><span style="color: #007700">*</span><span style="color: #0000BB">$onPage</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$onPage</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;Добавляем&nbsp;лимит <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Получаем&nbsp;список&nbsp;объектов&nbsp;с&nbsp;помощью&nbsp;специального&nbsp;метода <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$aObjects&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ObjectsController</span><span style="color: #007700">::</span><span style="color: #0000BB">getInstance</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getObjectsList&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$sel</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getList&nbsp;</span><span style="color: #007700">()); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$response&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">ModuleResponse</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;Инициализируем&nbsp;объект,&nbsp;который&nbsp;должен&nbsp;возвратить&nbsp;метод <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$response</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setTemplate&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">'mymodule/index'</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;Указываем&nbsp;шаблон&nbsp;без&nbsp;расширения&nbsp;файла <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Пробегаемся&nbsp;по&nbsp;всем&nbsp;загруженным&nbsp;объектам&nbsp;и&nbsp;добавляем&nbsp;их&nbsp;в&nbsp;"ответ" <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">foreach&nbsp;(</span><span style="color: #0000BB">$aObjects&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$object</span><span style="color: #007700">)&nbsp;{ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$response</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addObject&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Добавляем&nbsp;объект&nbsp;класса&nbsp;Array2XML,&nbsp;который&nbsp;будет&nbsp;переведен&nbsp;в&nbsp;соответствующую&nbsp;XML-таблицу <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;для&nbsp;постраничной&nbsp;навигации <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$response</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addObject&nbsp;</span><span style="color: #007700">(new&nbsp;</span><span style="color: #0000BB">Array2XML&nbsp;</span><span style="color: #007700">(</span><span style="color: #DD0000">'pages'</span><span style="color: #007700">,&nbsp;array&nbsp;( <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'onpage'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$onPage</span><span style="color: #007700">, <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'total'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$sel</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTotalCount&nbsp;</span><span style="color: #007700">(), <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'page'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;++</span><span style="color: #0000BB">$currentPage <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">))); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$response</span><span style="color: #007700">; <br />&nbsp;&nbsp;&nbsp;&nbsp;} <br />&nbsp;&nbsp;&nbsp;&nbsp; <br />}</span> </span> </code>    
</div>
</div>

<h2>Языковой файл</h2>
<div>Если Вы собираетесь предоставлять доступ к вашему модулю пользователю напрямую, т.е.
через URI сайта, то в качестве заголовка страницы по-умолчанию будет использоваться
языковая переменная <i>module_header</i>.</p><p>Файл: <i>~/explay/modules/mymodule/i18n.ru.php</i></p></div>
<div class="sample">
<div class="sample_content">
<code><span style="color: #000000"> <span style="color: #0000BB">&lt;?php <br /> <br />$LANG&nbsp;</span><span style="color: #007700">=&nbsp;array&nbsp;(</span><span style="color: #DD0000">'module_header'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'Последние&nbsp;публикации&nbsp;в&nbsp;блогах'</span><span style="color: #007700">);&nbsp;</span> </span> </code>  
</div>
</div>

<h2>Шаблон</h2>
<div><p>После создания класса необходимо создать XSLT-шаблон, который будет
транслировать XML-таблицу списка объектов в HTML-код.</p>
<p>Файл <i>~/explay/templates/xsl/mymodule/index.xsl</i></p></div>
<div class="sample">
<div class="sample_content">
<code><span style="color: #000000"> <span style="color: #0000BB">&lt;?xml&nbsp;version</span><span style="color: #007700">=</span><span style="color: #DD0000">"1.0"&nbsp;</span><span style="color: #0000BB">encoding</span><span style="color: #007700">=</span><span style="color: #DD0000">"UTF-8"</span><span style="color: #0000BB">?&gt; <br /></span> <br />&lt;xsl:stylesheet&nbsp;version="1.0"&nbsp;xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--&nbsp;Шаблоно-обработчик&nbsp;постраничной&nbsp;навигации&nbsp;--&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:include&nbsp;href="../common/navigation.xsl"&nbsp;/&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:template&nbsp;match="/data"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;html&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;head&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:value-of&nbsp;select="@title"&nbsp;/&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/title&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/head&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;body&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:apply-templates&nbsp;select="response/object[@type='article'&nbsp;or&nbsp;@type='link']"&nbsp;/&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:apply-templates&nbsp;select="pages"&nbsp;mode="pages-navigation"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:with-param&nbsp;name="href"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:text&gt;/mymodule&lt;/xsl:text&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:with-param&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:apply-templates&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/body&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/html&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:template&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--&nbsp;Шаблон&nbsp;для&nbsp;статей&nbsp;--&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:template&nbsp;match="object[@type='article']"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:param&nbsp;name="id"&nbsp;select="@id"&nbsp;/&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:text&gt;Cтатья:&nbsp;&lt;/xsl:text&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;href="/blogs/post/article/{$id}"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:value-of&nbsp;select="property[@name='title']/value"&nbsp;/&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/a&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:text&gt;&nbsp;&lt;/xsl:text&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;small&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:value-of&nbsp;select="property[@name='pubdate']/value"&nbsp;/&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/small&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:template&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--&nbsp;Шаблон&nbsp;для&nbsp;ссылок&nbsp;--&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:template&nbsp;match="object[@type='link']"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:param&nbsp;name="id"&nbsp;select="@id"&nbsp;/&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:text&gt;Ссылка:&nbsp;&lt;/xsl:text&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a&nbsp;href="/blogs/post/link/{$id}"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:value-of&nbsp;select="property[@name='title']/value"&nbsp;/&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/a&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:text&gt;&nbsp;&lt;/xsl:text&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;small&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl:value-of&nbsp;select="property[@name='pubdate']/value"&nbsp;/&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/small&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl:template&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp; <br />&lt;/xsl:stylesheet&gt;</span> </code>  
</div>
</div>

<h2>Результат</h2>
<div>Теперь результат доступен по сслке http://localhost/mymodule</div>

</body>
</html>